import { Module } from 'vuex';
import { proRequireState } from './types';
import { RootState } from '../../type';
import storage from '@/utils/helper/storage';
const state: proRequireState = {
    checkedList: storage.get('proRequire') || []
};

type StateType = typeof state

const proRequire: Module<StateType, RootState> = {
    namespaced: true,
    state,
    mutations: {
        SET_CHECKEDLIST: (state, payload) => {
            state.checkedList = payload;
            storage.set('proRequire', payload);
        }
    }
};

export default proRequire;
